<ui:composition template="/resources/templates/table.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets">

    <ui:define name="table-header">
        <f:event listener="#{modulesTable.renderTable}" type="preRenderView"/>
        <h:outputText value="#{msgs['table.modules']}" styleClass="table_name"/>
    </ui:define>

    <!--<ui:define name="button-menu-top">-->
    <!--</ui:define>-->

    <ui:define name="table-content">
        <h:form>
            <div>
                <h:commandButton value="#{msgs['edit']}" action="#{moduleController}"
                                 styleClass="margin2ptb">
                    <f:param name="tab" value="modules"/>
                    <f:param name="page" value="#{modulesTable.currentPage}"/>
                </h:commandButton>
            </div>
            <div class="table_wrapper">
                <div>
                    <div>
                        <div style="width: 100%;">
                            <table border="0" cellspacing="0" cellpadding="0" class="table_data">
                                <thead>
                                <tr>
                                    <th class="th_data_first"></th>
                                    <th class="th_data">#{msgs['code']}</th>
                                    <th class="th_data">#{msgs['name']}</th>
                                    <th class="th_data">#{msgs['visible']}</th>
                                    <th class="th_data">#{msgs['pages']}</th>
                                    <th class="th_data">#{msgs['description']}</th>
                                </tr>
                                </thead>
                                <ui:repeat value="#{modulesTable.pagebleRecords}" var="module"
                                           varStatus="moduleindex">
                                    <tr class="#{moduleindex.even ? 'even' : 'odd'}">
                                        <td class="td_data_first">
                                            <input type="radio" value="#{module.id}" name="moduleBeanId"/>
                                        </td>
                                        <td class="td_data">#{module.code}</td>
                                        <td class="td_data">#{module.name}</td>
                                        <td class="td_data">#{msgs[module.visible]}</td>
                                        <td class="td_data pre">
                                            <h:outputText value="#{module.pagesForView}"/>
                                        </td>
                                        <td class="td_data">#{module.description}</td>
                                    </tr>
                                </ui:repeat>
                            </table>
                        </div>
                    </div>
                </div>
                <ui:include src="/resources/includes/pagination.xhtml">
                    <ui:param name="paginationBean" value="#{modulesTable}"/>
                </ui:include>
            </div>
            <div>
                <div>
                    <h:commandButton value="#{msgs['edit']}" action="#{moduleController}"
                                     styleClass="margin2ptb">
                        <f:param name="tab" value="modules"/>
                        <f:param name="page" value="#{modulesTable.currentPage}"/>
                    </h:commandButton>
                </div>
            </div>
        </h:form>
    </ui:define>

    <!--<ui:define name="button-menu-bottom">-->
    <!--</ui:define>-->

</ui:composition>